<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>axios 应用</title>
    <link rel="shortcut icon" href="../lib/image/favicon.ico" type="image/x-icon">
    <link rel="stylesheet" href="../lib/css/all.css">

</head>

<body>
    <div id="app"></div>
</body>
<script>
    const service = axios.create({
        baseURL: '',
        timeout: 2000
    })

    service.interceptors.request.use(
        config => {
            console.log(config)
            console.log(!config.data)
            if (!config.data) {
                config['data'] = {}
            }

            console.log(typeof config.data === 'object')


        }
    )

    service.get('l?id=1&name="张三"', { token: '111', data: '' });
</script>

</html>